﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MeetIterator
{
    class PancakeHouseMenuIterator:Iterator
    {
        ArrayList menuItems;
        int position = 0;

        public PancakeHouseMenuIterator(ArrayList menu)
        {
            menuItems = menu;
        }
        public bool hasNext()
        {
            if (position >= menuItems.Count || menuItems[position] == null)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        public object next()
        {
            position++;
            return menuItems[position - 1];
        }
    }
}
